package com.example.fist.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "admin", schema = "competition",catalog = "")
public class AdminEntity {
    private int adId;
    private String pass;
    private Integer shId;
    private String name;
    private int work;
    private int sex;
    private String mail;
    private String phone;
    private String school;
    private String adType;
    private int isvisible;
    private String note;
    private Date modifiTime;
    private Date regisTime;

    @Id
    @Column(name = "ad_id", nullable = false)
    public int getAdId() {
        return adId;
    }

    public void setAdId(int adId) {
        this.adId = adId;
    }

    @Basic
    @Column(name = "pass", nullable = false, length = 20)
    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    @Basic
    @Column(name = "sh_id", nullable = true)
    public Integer getShId() {
        return shId;
    }

    public void setShId(Integer shId) {
        this.shId = shId;
    }

    @Basic
    @Column(name = "name", nullable = false, length = 10)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "work", nullable = false)
    public int getWork() {
        return work;
    }

    public void setWork(int work) {
        this.work = work;
    }

    @Basic
    @Column(name = "sex", nullable = false)
    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "mail", nullable = false, length = 40)
    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    @Basic
    @Column(name = "phone", nullable = false, length = 15)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "school", nullable = false, length = 30)
    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    @Basic
    @Column(name = "ad_type", nullable = false, length = 30)
    public String getAdType() {
        return adType;
    }

    public void setAdType(String adType) {
        this.adType = adType;
    }

    @Basic
    @Column(name = "isvisible", nullable = false)
    public int getIsvisible() {
        return isvisible;
    }

    public void setIsvisible(int isvisible) {
        this.isvisible = isvisible;
    }

    @Basic
    @Column(name = "note", nullable = false, length = -1)
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Basic
    @Column(name = "modifi_time", nullable = false)
    public Date getModifiTime() {
        return modifiTime;
    }

    public void setModifiTime(Date modifiTime) {
        this.modifiTime = modifiTime;
    }

    @Basic
    @Column(name = "regis_time", nullable = false)
    public Date getRegisTime() {
        return regisTime;
    }

    public void setRegisTime(Date regisTime) {
        this.regisTime = regisTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AdminEntity that = (AdminEntity) o;
        return adId == that.adId &&
                work == that.work &&
                sex == that.sex &&
                isvisible == that.isvisible &&
                Objects.equals(pass, that.pass) &&
                Objects.equals(shId, that.shId) &&
                Objects.equals(name, that.name) &&
                Objects.equals(mail, that.mail) &&
                Objects.equals(phone, that.phone) &&
                Objects.equals(school, that.school) &&
                Objects.equals(adType, that.adType) &&
                Objects.equals(note, that.note) &&
                Objects.equals(modifiTime, that.modifiTime) &&
                Objects.equals(regisTime, that.regisTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(adId, pass, shId, name, work, sex, mail, phone, school, adType, isvisible, note, modifiTime, regisTime);
    }
}
